<?php
/**
 * Created by PhpStorm.
 * User: lvshuyun
 * Date: 2015/6/15
 * Time: 15:55
 */

use common\widgets\ActiveForm;
use common\widgets\FormTable;
use common\models\CommonModel;
use common\models\DAO\AdPosition;


$form = ActiveForm::begin();
echo FormTable::widget([
    'form' => $form,
    'model' => $model,
    'rows' => [
        'type' => [
            'type' => FormTable::INPUT_RADIO_LIST,
            'items' => [
                1 => '图片'
            ],
            'options' => [
                'defaultValue' => 1
            ]
        ],
        'title' => [
            'type' => FormTable::INPUT_TEXT,
            'width' => 6,
        ],
        'positionID' => [
            'type' => FormTable::INPUT_DROPDOWN_LIST,
            'items' => CommonModel::getSimpleList(new AdPosition(), 'id', 'title'),
            'options' => [
                'initValue' => '--请选择广告位--'
            ],
        ],
        'url' => [
            'type' => FormTable::INPUT_TEXT,
            'width' => 6,
        ],
        'content' => [
            'type' => FormTable::INPUT_WIDGET,
            'widgetClass' => 'common\widgets\UploadImage',
        ],
        'openType' => [
            'type' => FormTable::INPUT_RADIO_LIST,
            'items' => [
                '_self' => '本窗口打开',
                '_blank' => '新窗口打开',
                '_parent' => '父框架打开',
                '_top' => '顶框架打开',
            ],
            'options' => [
                'defaultValue' => '_self'
            ]
        ],
        'status' => [
            'type' => FormTable::INPUT_RADIO_LIST,
            'items' => [
                0 => '不显示',
                1 => '显示'
            ],
            'options' => [
                'defaultValue' => '1'
            ]
        ],
    ]
]);

ActiveForm::end();